﻿<Window x:Class="Resn.WhuPub.WPFClientUI.UpdateBranchWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Style="{StaticResource WindowStyle}" WindowStartupLocation="CenterScreen"
        Loaded="Window_Loaded" MouseDown="Window_OnMouseDown">
        <Grid Name="LayoutRoot">
                <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>

                <Grid Background="{StaticResource TitleGridColor}">
                        <TextBlock Text="编辑校区" Style="{DynamicResource BigTextBlockStyle}" />
                </Grid>

                <Grid Grid.Row="1" Background="{StaticResource ContentGridColor}">
                        <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" Grid.Row="0" Text="名称" />
                        <TextBox Grid.Column="1" Grid.Row="0"
                                 Text="{Binding Branch.Name, UpdateSourceTrigger=PropertyChanged}" />

                        <TextBlock Grid.Column="0" Grid.Row="1" Text="省份" />
                        <ComboBox Grid.Column="1" Grid.Row="1"
                                  Name="BranchProvinceComboBox"
                                  ItemsSource="{Binding Provinces}"
                                  DisplayMemberPath="Name"
                                  SelectedValue="{Binding Province, UpdateSourceTrigger=PropertyChanged}" />

                        <TextBlock Grid.Column="0" Grid.Row="2" Text="城市" />
                        <ComboBox Grid.Column="1" Grid.Row="2"
                                  Name="BranchCityComboBox"
                                  ItemsSource="{Binding Citys}"
                                  DisplayMemberPath="Name"
                                  SelectedValue="{Binding City, UpdateSourceTrigger=PropertyChanged}" />

                        <TextBlock Grid.Column="0" Grid.Row="3" Text="地址" />
                        <TextBox Grid.Column="1" Grid.Row="3"
                                 Name="BranchAddressTextBox"
                                 Text="{Binding Branch.Address}" />

                        <TextBlock Grid.Column="0" Grid.Row="4" Text="邮编" />
                        <TextBox Grid.Column="1" Grid.Row="4"
                                 Name="BranchPostcodeTextBox"
                                 Text="{Binding Branch.Postcode}" />

                        <TextBlock Grid.Column="0" Grid.Row="5"
                                   Text="网址" />
                        <TextBox Grid.Column="1" Grid.Row="5"
                                 Name="BranchWebsiteTextBox"
                                 Text="{Binding Branch.Website}" />
                </Grid>
                <Grid Grid.Row="2" Background="{StaticResource ContentGridColor}">
                        <Grid.ColumnDefinitions>
                                <ColumnDefinition />
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                        <Button Grid.Column="1" Style="{DynamicResource WindowCancelButtonStyle}" />
                        <Button Grid.Column="2" Style="{DynamicResource WindowAcceptButtonStyle}"
                                Click="AcceptButton_Click" />
                </Grid>
        </Grid>
</Window>